#include <bits/stdc++.h>
// 2025/01/19
// tag: 
// Author: Zhang Muen
using namespace std;

int64_t n;
vector<vector<int64_t>> matrix_mutiply(vector<vector<int64_t>> &a, vector<vector<int64_t>> &b){
    vector<vector<int64_t>> res = {{0, 0}, {0, 0}};
    for (int i = 0; i < 2; i++)
        for (int j = 0; j < 2; j++)
            res[i][j] = (a[i][0] * b[0][j] + a[i][1] * b[1][j]) % 1000000007;
    return res;
}

vector<vector<int64_t>> matrix_power(vector<vector<int64_t>> &a, int64_t n){
    vector<vector<int64_t>> res = {{1, 0}, {0, 1}};
    while (n){
        if (n & 1)
            res = matrix_mutiply(res, a);
        a = matrix_mutiply(a, a);
        n >>= 1;
    }
    return res;
}

signed main()
{
    cin >> n;
    if (n < 2){
        cout << n;
        return 0;
    }
    vector<vector<int64_t>> a = {{1, 1}, {1, 0}};
    vector<vector<int64_t>> res = matrix_power(a, n - 1);
    cout << res[0][0];
    return 0;
}